package com.myapp.forms;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class ConnectionForm extends ActionForm{
	private String login;
	private String pwd;
	
	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	/**
	 * Methode qui v�rifie la validit� des propri�t�s
	 */
	@Override
	public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		if(login.equals("") || pwd.equals("") ) {
			errors.add("indentifiants",new ActionMessage("error.identifiants.required"));
		}
		return errors;
	}
}
